#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int k, a[100];
	cin >> k;
	for (int i = 0;i < k;i++)
	{
		cin >> a[i];
	}
	cout << count(a, a + k, 1) << endl;
	cout << count(a, a + k, 5) << endl;
	cout << count(a, a + k, 10) << endl;
	return 0;
}